#ifndef __DAEMON_SUB_PROCESS_H_
#define __DAEMON_SUB_PROCESS_H_
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/reboot.h>
#include <signal.h>

#define GATEWAY_CMD "/usr/bin/gateway"

typedef struct {
    int pid;
    char *sub_arg;
    int fail_count;
} daemon_sub_process_t;

/**
 * @brief 子进程的初始化
 */
daemon_sub_process_t *daemon_sub_process_init(char *sub_arg);


/**
 * @brief 对子进程的检查和启动
 */
void daemon_sub_process_check_and_start(daemon_sub_process_t *sub_process);


/**
 * @brief 销毁子进程
 */
void daemon_sub_process_destroy(daemon_sub_process_t *sub_process);


#endif // __DAEMON_SUB_PROCESS_H_
